from odoo import models, fields, tools
import base64


class ResCompany(models.Model):
    
    _inherit = 'res.company'

    def _default_favicon(self):
        with tools.file_open('fkc_theme/static/img/favicon.png', 'rb') as f:
            return base64.b64encode(f.read())

    favicon = fields.Binary(
        string="Company Favicon", 
        attachment=True,
        default=_default_favicon
    )

